/*
 * Copyright (C) 2016 alchemystar, Inc. All Rights Reserved.
 */
package live.sidian.database.synchronizer.sync.structure.model;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.LinkedList;
import java.util.List;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Table implements Serializable {
    /**
     * 数据库名
     */
    private String schema;
    /**
     * 表名
     */
    private String name;
    /**
     * 建表语句
     */
    private String createSql;
    /**
     * 表的全部字段
     */
    @Builder.Default
    private List<Column> columns = new LinkedList<>();
    /**
     * 全部索引
     */
    @Builder.Default
    private List<Index> indexes = new LinkedList<>();

    public Table(String schema, String name) {
        this.schema = schema;
        this.name = name;
    }
}
